package service;

import midel.Major.major;
import model.Major;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class MajorService {
    private MajorDao dao;
    @Autowired
    public void setMajorDao(MajorDao dao){
        this.dao=dao;
    }
    public boolean deleteMajor(String majorId){
        return dao.deleteMajor(majorId)>0;
    }
    public ArrayList<Major> getMajor(String majorId){
        return dao.findMajorByMajorid(majorId);
    }
    public ArrayList<Major> getAllMajors(){
        return dao.getAllMajors();
    }
    public boolean editMajor(Major major){
        return dao.editMajor(major)>0;
    }
    public boolean addMajor(Major major){
        return  dao.addMajor(major)>0;
    }
}
